package practices;

import java.io.IOException;

public class Mp4ToMp3Converter {
    public static void convert(String inputFilePath, String outputFilePath) {
        try {
            ProcessBuilder processBuilder = new ProcessBuilder("ffmpeg", "-i", inputFilePath, outputFilePath);
            processBuilder.inheritIO().start().waitFor();
        } catch (IOException | InterruptedException e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        String inputFilePath = "/Users/weimeiling/IdeaProjects/ExcelXiaoDingDang/src/main/resources/40422_1746335406.mp4";
        String outputFilePath = "/Users/weimeiling/IdeaProjects/ExcelXiaoDingDang/src/main/resources/1.mp3";
        convert(inputFilePath, outputFilePath);
    }
}
